import Vue from 'vue'
import VueRouter from 'vue-router'

import ToDoList from "../views/ToDoList.vue"
import BookManage from "../views/BookManage.vue"
import Index from "../views/Index.vue"
import AddBook from "../views/AddBook.vue"
import BookUpdate from "../views/BookUpdate.vue"
import PageFour from "../views/PageFour.vue"
import Page5 from "../views/Page5.vue"
import MapDemo from "../views/MapDemo.vue"
import Map3DDemo from "../views/Map3DDemo.vue"
import Map3DDemo2 from "../views/Map3DDemo2.vue"
import Map3DDemo3 from "../views/Map3DDemo3.vue"
import MapLeafletNewDemo from "../views/MapLeafletNewDemo.vue"
import MapLeafletMarkerCluster from "../views/MapLeafletMarkerCluster.vue"

Vue.use(VueRouter)

const routes = [
    {
        path: "/",
        name: "地图测试",
        component: Index,
        redirect: "/LeafletNewDemo",
        show: true,

        children: [
            {
                path: "/LeafletNewDemo",
                name: "Leaflet地图",
                component: MapLeafletNewDemo
            },
            {
                path: "/LeafletMarkerCluster",
                name: "Leaflet点聚合测试",
                component: MapLeafletMarkerCluster
            },
            {
                path: "/LeafletDemo",
                name: "Leaflet标绘",
                component: PageFour
            },
            {
                path: "/LeafletDemo2",
                name: "Leaflet北京市地图",
                component: Page5
            },
            {
                path: "/OpenLayersDemo",
                name: "OpenLayers地图",
                component: MapDemo
            },
            {
                path: "/CesiumDemo",
                name: "Cesium地图",
                component: Map3DDemo
            },
            {
                path: "/CesiumDemo2",
                name: "Cesium地图2",
                component: Map3DDemo2
            },
            {
                path: "/CesiumDemo3",
                name: "Cesium地图3-拉萨市",
                component: Map3DDemo3
            },
        ]
    },
    {
        path: "/Admin",
        name: "图书管理",
        component: Index,
        redirect: "/ToDoList",
        show: true,

        children: [
            {
                path: "/BookManage",
                name: "查询图书",
                component: BookManage
            },
            {
                path: "/AddBook",
                name: "添加图书",
                component: AddBook
            },
            {
                path: "/ToDoList",
                name: "编辑待办事项",
                component: ToDoList
            },
        ]
    },
    {
        path: '/update',
        component: BookUpdate,
        show: false
    }

]

const router = new VueRouter({
    mode: 'hash',
    base: process.env.BASE_URL,
    routes
})

export default router
